package custom.cards;

import custom.cards.GameRequest.RequestType;
import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class Player extends ImageView{

	String playerId;
	String playerName;
	TextView displayName;

	public Player(TextView name, String _playerName, String _playerId, Context context) 
	{
		super(context);
		playerId = _playerId;
		playerName = _playerName;
		displayName = name;
		this.setText(playerName);
	}
	
	public Player(String _playerName, String _playerId, Context context) 
	{
		super(context);
		playerId = _playerId;
		playerName = _playerName;
		displayName = new TextView(context);
		this.setText(playerName);
	}
	public void setText(String name)
	{
		displayName.setText(name);
	}
	
	public void AddCard(Card cardToAdd)
	{

		  
		  GameRequest req = new GameRequest(GamePlayActivity.gameID,GamePlayActivity.playerID,GamePlayActivity.playerID,this.playerId,cardToAdd,RequestType.PassCard,false);
		  req.isShown = cardToAdd.cardShowing;
		  new NetworkTask(req).execute();
	}
	
}
